import { createApp } from 'vue'
//引入element plus
import ElementPlus from 'element-plus'
//element国际化
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import App from './App.vue'
//暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
//svg配置项代码
import 'virtual:svg-icons-register'

import gloablComponent from './components/index'

//引入默认样式
import '@/styles/index.scss'

//引入路由
import router from './router/index'

//引入pinia
import pinia from './store'
//引入路由守卫
import './permission'
//引入自定义指令文件
import { isHasButton } from '@/directive/has'

//获取应用实例
const app = createApp(App)
isHasButton(app)
//注册路由
app.use(router)

//安装插件,element国际化
app.use(ElementPlus, {
  locale: zhCn,
})

//注册全局组件
app.use(gloablComponent)

//安装pinia
// app.use(pinia)

//挂载应用
app.use(pinia).mount('#app')
